<?php

namespace App\Model\Logic;

use App\Model\User;

class LoginLogic
{
    //
    public function checkLogin(array $data){
        $info = User::where('username',$data['username'])->first();
        if($info){
            if($info['password'] == $data['password']){
                session(['userinfo'=>$info]);
                return true;
            }
            return false;
        }
        return false;
    }
}
